Skip to content

chore: Merge 4.77.1 into single-server - #7804

Merged
diegolmello merged 5 commits into
single-serverfrom
release/4.77.1-single-server
Oct 13, 2026
Merged

diegolmello merged 5 commits into
single-serverfrom
release/4.77.1-single-server

Conversation

@diegolmello

@diegolmello diegolmello commented Oct 13, 2026 •

Copy link
Copy Markdown
Member

Proposed changes

Patch release 4.77.1 for single-server: the same cherry-picks as #7779, applied on top of single-server.

All five applied with no conflicts (NewServerView auto-merged). The diff between this branch and 4.77.1 is the same as the existing diff between single-server and the 4.77.0 release, so the single-server changes are untouched.

Issue(s)

https://rocketchat.atlassian.net/browse/NATIVE-1740

How to test or reproduce

  1. Build the single-server app and open it logged out: it starts on the workspace screen for the configured server.
  2. Log in, then log out: it returns to the workspace screen for the configured server.
  3. Open Settings > Display: the option reads "Categories" and toggles type groups and custom categories together.
  4. Open a message with an image hosted outside the workspace: the image is requested without rc_token/rc_uid.
  5. On iOS, open a PDF attachment: the markup button shows in the toolbar.
  6. Check that the app reports version 4.77.1.

Screenshots

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • Improvement (non-breaking change which improves a current function)
  • New feature (non-breaking change which adds functionality)
  • Documentation update (if none of the other choices apply)

Checklist

  • I have read the CONTRIBUTING doc
  • I have signed the CLA
  • Lint and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works (if applicable)
  • I have added necessary documentation (if applicable)
  • Any dependent changes have been merged and published in downstream modules

Further comments

diegolmello and others added 5 commits October 13, 2026 09:18
* fix: scope getServerInfo request headers to known servers

Only attach the stored auth headers when the user is already signed in to
the requested server, and add tests.

* fix: only send auth headers in getServerInfo to servers the user is signed in to

Drops the Basic auth handling and skipCustomHeaders option from the previous commit and reverts fetch.ts to develop.

* remove comment

* coderabbit suggestion

* fix: address review comments for deep-link consent and getServerInfo

- extract getSessionHeaders to fix oxlint complexity
- move getServerInfo test to __tests__ folder
- prompt before first request to new deep-link host

* fix: scope Basic Authorization to requested server in getServerInfo

Load Basic auth only for the requested host and skip global customHeaders so deep links to unknown hosts no longer receive the active workspace credentials.

* refactor: pass serverRecord to ensureDeepLinkLoginConsent and cover the known-host branch

The callers already hold serverRecord, so the consent check no longer re-reads MMKV and the database. The known-host test now uses a server record without a signed-in user so it reaches the new branch.

* fix: scope Basic Authorization on the cloud lookup and add-server requests

getUniqueId and the add-server requests (getLoginServices, getLoginSettings)
still merged the global custom headers, so the current workspace's Basic
Authorization reached the requested host after the scoped /api/info call.

getUniqueId now sends only the requested server's stored Basic auth, and
handleServerRequest points the global Basic auth at the requested server
before making any request.

* fix: keep Basic auth and session headers scoped to the right server

- restore the active workspace's Basic auth when the add-workspace flow is closed
- stop sending the global Basic auth to the releases.rocket.chat lookup
- require the stored token, not only the user id, before sending session headers
- cover the call-push consent branches

* fix: end the VoIP call when the sign-in prompt is declined

* test: restore customHeaders after each fetch test and drop redundant skipCustomHeaders assertions

* revert: move applyBasicAuth handling in selectServer out of this PR

* Revert "revert: move applyBasicAuth handling in selectServer out of this PR"

This reverts commit 48a3f45.

* revert: drop VoIP call cleanup on declined deep-link consent

Reverts 924bbf7. The extra handleVoipAcceptFailed call on the decline
branch is not part of the credential-leak fix this PR is about.

* fix: restore the active workspace's Basic auth when the add-workspace flow finishes

Re-apply the connected workspace's stored Basic auth on FINISH_ADD so a
failed probe can't leave the probed host's header on later requests.

* fix: restore the active workspace's Basic auth as soon as the add-workspace probe ends

handleServerRequest swaps the global Basic auth to the probed host and
only handed it back on FINISH_ADD, so a failed connect left the active
workspace's requests carrying the wrong Authorization until the form
unmounted. Restore it in a finally block instead and drop the FINISH_ADD
watcher, which keyed off sdk.host before the new connection existed.

* fix: address review comments on scoped probe auth and deep-link consent

- Guard hardware back while the add-workspace check runs so the
  active workspace Basic auth can't leak to the probed host
- Drop the redundant global Basic auth write in NewServerView
- Let fetch callers' headers win over global custom headers and add
  the getBasicAuthKey helper
- Send per-request Basic auth in getLoginServices/getLoginSettings and
  scope the global swap in getWebsocketInfo to the handshake only, so
  the probe no longer touches the shared headers
- Thread the requested server version through the cloud unique-id lookup
- Neutral deep-link consent copy for tokenless links

* chore(i18n): add Deep_link_open_* strings for tokenless deep-link consent

* refactor: simplify scoped Basic auth handling and share stored-session lookup

- keep the add-workspace websocket handshake swap inline in getWebsocketInfo
- read the stored user id and token through getStoredSession everywhere
- select the deep-link consent copy from a table instead of repeated ternaries
- only swallow hardware back while connecting when there is a workspace to return to
- remove explanatory comments from tests

* refactor: fold add-workspace back guard into handleBackPress

* test: cover the add-workspace hardware back guard in NewServerView

* fix: restore the active workspace headers before the add-workspace handshake settles

* fix: scope the auto-lock time sync request to the requested server's Basic auth

* refactor: share applyBasicAuth and finish the deep-link consent rename

* fix: end the VoIP call when the deep-link open prompt is declined

Also rename shouldAutoConfirmDeepLinkLogin to shouldAutoConfirmDeepLinkConsent now that it gates both prompts.

* test: seed a stale header in the reselect test and use ~/ imports in the new tests

* fix: skip the DM navigation when the deep-link open prompt is declined after a failed VoIP accept

Declining the prompt only needs to end the call and reset the VoIP state. Running the full failed-accept handler also tried to open a DM with the caller on the active workspace, which is not the host the user declined.

* fix: send Basic auth to the iframe SSO endpoint only on the server's own origin

The iframe login fetch went through the shared headers, so it carried the active workspace's Basic Authorization to whatever host Accounts_Iframe_api_url points at. It now sends the stored Basic auth only when the URL has the same origin as the server.

* test: drop dead active-server setup from the probeAuth tests

* refactor: restore isLoggedInServer to read only the user id

* test: use ~/ imports for collaborators in getServerInfo and getLoginSettings tests

* test: move logout test into __tests__ and use ~/ paths in jest.mock calls

* test: use fake timers in getServerTimeSync tests to stop leaking the race timeout

* test path fix

* test: drive the probe handshake through the real SDK so header timing is pinned at WebSocket construction

* refactor: rename getBasicAuthHeader module to serverBasicAuth

* fix: send /api/info the requested server's own stored session

* refactor: read the stored session through getStoredSession in removeServer

test: cover the back handler when connecting flips after mount

* fix: send each page of the public settings fetch the requested server's own Basic auth

* refactor: address review feedback on basic auth and deep-link consent helpers

Drop the unreachable early-return applyBasicAuth and its test, fold setBasicAuth into applyBasicAuth, rename the probe test array, and pass isKnownHost to ensureDeepLinkConsent.

* fix: time out the add-workspace probe when the host never answers

Race the probe against a 30s timer so a host that accepts the connection and never responds can't leave the user stuck on Add workspace, and show a dedicated Connection_timed_out message.

* fix: abort the add-workspace probe requests when it times out or is superseded

A probe that timed out kept its settings and login-services requests running, so a late reply could overwrite the active workspace's settings. The probe now shares one abort signal across its requests and closes the websocket probe on abort.

* using workspace instead of server

* some more changes

* refactor: share the workspace basic auth helpers and abort the whole add-workspace probe

Every per-workspace request now goes through fetchForWorkspace, and the websocket handshake header swap through withBasicAuth, both in serverBasicAuth, so a call site can no longer forget to scope the Basic auth. The probe's abort signal now also reaches the /api/info, unique-id and supported-versions requests; an abort that comes from that signal leaves the store alone instead of failing the active workspace's connection. The NewServerView back handler is back to plain functions with explicit effect deps, the getLoginSettings tests live in getSettings.test.ts, and the fetch spy shared by the basic auth tests is testUtils/mockGlobalFetch.

* refactor: drop unrequested renames in logout test and deep-link auto-confirm helper

* fix: send the shared Basic auth only to the workspace origin

fetch attaches the shared Authorization only to the origin applyBasicAuth recorded it for, and fetchForWorkspace sends the stored Basic auth only to the server's own origin. This replaces the per-call Authorization overrides on the supported-versions lookup and the iframe SSO request, and moves the origin comparison into isSameOrigin next to getOrigin.

* refactor: restore the inline session read in removeServer

Logout is left for a follow-up, so removeServer reads the stored user id and token the way it did before.

* refactor: let the deep-link callers decide whether consent is needed

Drops the isKnownHost flag from ensureDeepLinkConsent. handleOpenDifferentServer and handleClickCallPush now skip the prompt for known hosts without a token.

* test: move the logout test into __tests__

Uses ~/ paths in the jest.mock calls.

* refactor: share the deep-link consent predicate between both callers

handleOpenDifferentServer and handleClickCallPush repeated the same
"token or unknown host" condition, which pushed handleClickCallPush over
the cognitive complexity limit. Name it once as requiresDeepLinkConsent.

* refactor: keep the add-workspace probe result typed through the timeout race
@coderabbitai

coderabbitai Bot commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 68f92880-49cd-423d-96e6-628fafc70bb1
📥 Commits

Reviewing files that changed from the base of the PR and between 0ad55fb and 6913cb9.

📒 Files selected for processing (73)
  • .maestro/tests/assorted/display-perf.yaml
  • android/app/build.gradle
  • app/containers/message/components/Attachments/Reply.tsx
  • app/containers/message/components/Urls.tsx
  • app/containers/message/components/__tests__/Reply.test.tsx
  • app/containers/message/components/__tests__/Urls.test.tsx
  • app/containers/message/hooks/__tests__/useMediaAutoDownload.test.tsx
  • app/i18n/locales/ar.json
  • app/i18n/locales/bn-IN.json
  • app/i18n/locales/cs.json
  • app/i18n/locales/de.json
  • app/i18n/locales/en.json
  • app/i18n/locales/es.json
  • app/i18n/locales/fi.json
  • app/i18n/locales/fr.json
  • app/i18n/locales/hi-IN.json
  • app/i18n/locales/hu.json
  • app/i18n/locales/it.json
  • app/i18n/locales/ja.json
  • app/i18n/locales/nl.json
  • app/i18n/locales/nn.json
  • app/i18n/locales/no.json
  • app/i18n/locales/pt-BR.json
  • app/i18n/locales/pt-PT.json
  • app/i18n/locales/ru.json
  • app/i18n/locales/sl-SI.json
  • app/i18n/locales/sv.json
  • app/i18n/locales/ta-IN.json
  • app/i18n/locales/te-IN.json
  • app/i18n/locales/tr.json
  • app/i18n/locales/zh-CN.json
  • app/i18n/locales/zh-TW.json
  • app/lib/constants/keys.ts
  • app/lib/methods/__tests__/getServerInfo.test.ts
  • app/lib/methods/__tests__/getSettings.test.ts
  • app/lib/methods/__tests__/logout.test.ts
  • app/lib/methods/__tests__/serverBasicAuth.test.ts
  • app/lib/methods/getServerInfo.ts
  • app/lib/methods/getSettings.ts
  • app/lib/methods/helpers/__tests__/fetch.test.ts
  • app/lib/methods/helpers/__tests__/formatAttachmentUrl.test.ts
  • app/lib/methods/helpers/__tests__/getOrigin.test.ts
  • app/lib/methods/helpers/fetch.ts
  • app/lib/methods/helpers/fileDownload.ts
  • app/lib/methods/helpers/formatAttachmentUrl.ts
  • app/lib/methods/helpers/getOrigin.ts
  • app/lib/methods/loggedInServer.ts
  • app/lib/methods/logout.ts
  • app/lib/methods/serverBasicAuth.ts
  • app/lib/services/__tests__/connect.probeAuth.test.ts
  • app/lib/services/__tests__/getServerTimeSync.test.ts
  • app/lib/services/__tests__/restApi.getSupportedVersionsCloud.test.ts
  • app/lib/services/connect.ts
  • app/lib/services/getServerTimeSync.ts
  • app/lib/services/restApi.ts
  • app/lib/testUtils/mockGlobalFetch.ts
  • app/sagas/__tests__/deepLinking.test.ts
  • app/sagas/__tests__/selectServer.test.ts
  • app/sagas/deepLinking.js
  • app/sagas/selectServer.ts
  • app/views/AuthenticationWebView.tsx
  • app/views/DisplayPrefsView.tsx
  • app/views/NewServerView/__tests__/NewServerView.test.tsx
  • app/views/NewServerView/index.tsx
  • app/views/NewServerView/methods/__tests__/basicAuth.test.ts
  • app/views/NewServerView/methods/basicAuth.ts
  • app/views/RoomsListView/hooks/__tests__/groupRooms.test.ts
  • app/views/RoomsListView/hooks/groupRooms.ts
  • app/views/RoomsListView/hooks/useSubscriptions.ts
  • ios/RocketChat.xcodeproj/project.pbxproj
  • ios/RocketChatRN/Info.plist
  • ios/ShareRocketChatRN/Info.plist
  • package.json
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@diegolmello
diegolmello merged commit 85c8cbf into single-server Oct 13, 2026
5 of 7 checks passed
@diegolmello
diegolmello deleted the release/4.77.1-single-server branch October 13, 2026 12:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants